<?php
if ( defined('ABSPATH') )
	include_once ABSPATH . 'config.php';
else
    include_once 'config.php';

include_once ABSPATH."base/people.php";

$oid = "";
$id = "";

if(isset($_COOKIE["ombid"]))
{
	$id = $_COOKIE["ombid"];
}
else
{
	header("Location: index.php");
}


if(isset($_POST["btnSave"]))
{
	$person = new Person($id);

	if(strlen($person->screen_name)== 0)
	{
		$person->Connect($id);
	}

	$person->name = $_POST["txtName"];
	$person->screen_name = $_POST["txtScreenName"];
	$person->email = $_POST["txtEmail"];
	$person->image = $_POST["txtImage"];
	$person->Save();	
	
	echo "Saved";
	
	
	
}

if($id)
{
$person = new Person($id);
$name = $person->name;
$screen_name = $person->screen_name;
$email = $person->email;
$image = $person->image;
$address = $person->address;
$update_address = $person->update_address;
$ext_id = $person->ext_id;
}


include_once THEME_PATH."header.php";

?>
<div id="page">
<?php include_once "header.php"; ?>
<div id="content" class="widecolumn">
<input type="hidden" id="id">
<a href="index.php">Status</a> | <a href="javascript:void(0)" onclick="signout()">Sign Out</a>
<input type="hidden" id="id" value="<?php echo $id ?>" />
<form method="post">
<table cellspacing="0" cellpadding="10" border="0">
<td>Name</td>
<td><input type="text" id="txtName" name="txtName" value="<?php echo $name ?>" /></td>
</tr>
<tr>
<td>Screen Name</td>
<td><input type="text" id="txtScreenName" name="txtScreenName" value="<?php echo $screen_name ?>"/></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" id="txtEmail" name="txtEmail" value="<?php echo $email ?>" class="link" /></td>
</tr>
<tr>
<td>Image</td>
<td><input type="text" id="txtImage" name = "txtImage" value="<?php echo $image ?>" class="link"/></td>
</tr>
<tr>
<td>Address</td>
<td><?php echo $address ?></td>
</tr>
<tr>
<td>Identity</td>
<td><?php echo $ext_id ?></td>
</tr>
<tr>
<td></td>
<td><input type="submit" id="btnSave" name="btnSave" value="Save"/></td>
</tr>
</table>
</form>
</div>
<?php include_once THEME_PATH."footer.php";?>
